package org.test.ddd.domain.impl.db;

import org.springframework.stereotype.Repository;
import org.test.ddd.domain.models.LeverUser;
import org.test.ddd.domain.models.LeverUserRepository;
import org.test.ddd.domain.models.MyLoanRecords;

import javax.annotation.Resource;

@Repository
public class LeverUserRepositoryDB implements LeverUserRepository {
    @Resource
    LeverUserMapper leverUserMapper;
    @Resource
    MyLoanRecords myLoanRecords;

    @Override
    public LeverUser findById(int userId) {
        LeverUser leverUser = leverUserMapper.findById(userId);
        leverUser.setLeverUserRepository(this);
        leverUser.setMyLoanRecords(myLoanRecords);
        return leverUser;
    }

}
